﻿
using Grpc.Core;
using GrpcProtos.OrderService;
using GrpcProtos.UserService;
using Microsoft.Extensions.Options;
using OrderService.Domain.Repositories;
using SharedKernel.Infrastructure.Comm;
using SharedKernel.Infrastructure.Grpc.Options;
namespace OrderService.Grpc.Services
{
    /// <summary>
    /// 订单微服务的Grpc实现
    /// </summary>
    public class OrderGrpcServiceImpl : GrpcProtos.OrderService.OrderGrpcService.OrderGrpcServiceBase
    {
        private readonly IOrderRepository _orderRepository;
        private readonly GrpcClientOptions _grpcClientOptions;
        public OrderGrpcServiceImpl(IOptions<GrpcClientOptions> grpcClientOptions, IOrderRepository orderRepository)
        {
            _grpcClientOptions = grpcClientOptions.Value;
            _orderRepository = orderRepository;
        }

        public override Task<GetBuyProductListResponse> CreateOrder(GetBuyProductListRequest request, ServerCallContext context)
        {
            throw new NotImplementedException("测试错误");
            return base.CreateOrder(request, context);
        }
    }
}
